#pragma once

#pragma unmanaged

#include <BWSAL\Arbitrator.h>

#pragma managed

#include "Interfaces\IUnitArbitrator.h"

namespace BroodWar
{
	namespace Addon
	{
		public ref class UnitArbitrator sealed : public IUnitArbitrator
		{
		internal:
			BWSAL::UnitArbitrator* instance;

			UnitArbitrator();
			~UnitArbitrator();
			!UnitArbitrator();

			static UnitArbitrator^ s_instance;
		public:
			static property UnitArbitrator^ Instance { UnitArbitrator^ get(); }

			virtual bool SetBid(IUnitController^ controller, Unit^ unit, double bid);
			virtual bool SetBid(IUnitController^ controller, IEnumerable<Unit^>^ units, double bid);
			virtual bool RemoveBid(IUnitController^ controller, Unit^ unit);
			virtual bool RemoveBid(IUnitController^ controller, IEnumerable<Unit^>^ units);
			virtual bool RemoveAllBids(IUnitController^ controller);
			virtual bool RemoveController(IUnitController^ controller);
			virtual bool Accept(IUnitController^ controller, Unit^ unit, double bid);
			virtual bool Accept(IUnitController^ controller, IEnumerable<Unit^>^ units, double bid);
			virtual bool Accept(IUnitController^ controller, Unit^ unit);
			virtual bool Accept(IUnitController^ controller, IEnumerable<Unit^>^ units);
			virtual bool Decline(IUnitController^ controller, Unit^ unit, double bid);
			virtual bool Decline(IUnitController^ controller, IEnumerable<Unit^>^ units, double bid);
			virtual bool HasBid(Unit^ unit);
			//virtual Tuple<IUnitController^, double>^ GetHighestBidder(Unit^ unit);
			//virtual List<Tuple<IUnitController^, double>^>^ GetAllBidders(Unit^ unit);
			virtual HashSet<Unit^>^ GetObjects(IUnitController^ controller);
			virtual HashSet<Unit^>^ GetObjectsBidOn(IUnitController^ controller);
			virtual void OnRemoveObject(Unit^ unit);
			//virtual double GetBid(IUnitController^ controller, Unit^ unit);
			virtual void Update();
		};
	}
}
